@ECHO OFF

IF NOT EXIST .\bin\* MD .\bin
IF EXIST .\bin\* DEL /Q .\bin\*

COPY /Y toolbin\AssemblyInfo.cs bin\AssemblyInfo.cs
COPY /Y toolbin\CSharpTest.Net.Library.dll bin\CSharpTest.Net.Library.dll
COPY /Y toolbin\Google.ProtocolBuffers.dll bin\Google.ProtocolBuffers.dll
COPY /Y toolbin\Google.ProtocolBuffers.Serialization.dll bin\Google.ProtocolBuffers.Serialization.dll
COPY /Y toolbin\BouncyCastle.Crypto.dll bin\BouncyCastle.Crypto.dll
COPY /Y toolbin\nunit.framework.dll bin\nunit.framework.dll 

REM -- Generates code before building:
toolbin\CmdTool.exe build *.csproj /fast
IF ERRORLEVEL 1 GOTO FAIL


REM -- Builds all projects:
CSBuild.exe Rebuild
IF ERRORLEVEL 1 GOTO FAIL

ECHO.
GOTO EXIT

:FAIL

ECHO The command has failed.
ECHO.
XCOPY 2> NUL

:EXIT